<template>
    <div>
      <a-form :form="form">
        <a-row type="flex" align="middle">
            <a-col >
                <a-form-item>
                  <a-radio-group  @change="handleChange" v-decorator="[
                      'buildingType',{
                        initialValue:'1'
                      }
                  ]">
                      <a-radio value="1">默认对照集</a-radio>
                      <a-radio value="2">自建对照集</a-radio>
                  </a-radio-group>
                </a-form-item>
            </a-col>
            <a-col class="controlSetName" v-show="defaultValue==='2'">
                <span>
                    对照集名称:
                </span>
              <a-form-item>
                <BuildingSelector :ts="ts"
                  v-decorator="[
                    'buildingId',
                    {initialValue:'',  rules: [{ required: true, message: $t('please_input') + '对照集名称' + $t('exclamation_mark') }] }
                  ]"
                  placeholder="对照集名称"
                />
              </a-form-item>
            </a-col>
        </a-row>
      </a-form>
    </div>
</template>

<script>
export default {
    data() {
        return {
          form: this.$form.createForm(this, {name: this._uid, onValuesChange: (props, values) => this.onValuesChange(props, values)}),
          defaultValue:'',
          ts: 0
        }
    },
    methods:{
        handleChange(e) {
          this.defaultValue = e.target.value
        },
        onValuesChange(props, values) {
          this.$emit('handleChange', values);
      }
    }
}
</script>

<style lang="less">
.controlSetName{
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.controlSetName .ant-select{
    width: 200px;
    margin-left: 10px;
}
.controlSetName .ant-form-item{
  margin-bottom: 0px;
}

</style>